package com.ktyj.test;

import com.ktjy.entity.Employee;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    @Test
    public void test1(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Employee employee = (Employee) context.getBean("employee1");
        employee.show();
    }
    @Test
    public void test2(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Employee employee = (Employee) context.getBean("employee2");
        employee.show();
    }
    @Test
    public void test3(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Employee employee = (Employee) context.getBean("employee3");
        System.out.println("大家好，我是"+employee.getType()+"岗位的"+employee.getName()+"，今年"+employee.getAge()+"岁");
    }
    @Test
    public void test4(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Employee employee = (Employee) context.getBean("employee4");
        System.out.println("大家好，我是"+employee.getType()+"岗位的"+employee.getName()+"，今年"+employee.getAge()+"岁");
    }
}
